//---------------------------------------------------------------------------------
// Copyright (c) 2008 David Vescovi.  All rights reserved.
//
// Exercise GPIO line via Gumstix Managed API 
//
//---------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using Gumstix;

namespace GPIO_test
{
    class Program
    {
        static void Main(string[] args)
        {
            IO.Register.BitSet((uint)PXA270.GPIO.GPDR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 direction is output

            // toggle the IO line 10 times
            for (int I = 0; I < 10; I++)
            {
                IO.Register.Write((uint)PXA270.GPIO.GPSR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 set (1)
                System.Threading.Thread.Sleep(1000);
                IO.Register.Write((uint)PXA270.GPIO.GPCR3, (uint)PXA270.GPIOBit.fGPIOBit101);   // GPIO 101 clear (0)
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}
